import request from '@/config/axios'

// 用户回答记录 VO
export interface AnswerRecordVO {
  id: number // 主键id,即记录Id
  userId: number // 用户Id
  lastAnswerQuestionId: number // 上一次回答的问题Id
  answerNo: number // 用户第多少次答题
  status: number // 状态
}

// 用户回答记录 API
export const AnswerRecordApi = {
  // 查询用户回答记录分页
  getAnswerRecordPage: async (params: any) => {
    return await request.get({ url: `/record/answer-record/page`, params })
  },

  // 查询用户回答记录详情
  getAnswerRecord: async (id: number) => {
    return await request.get({ url: `/record/answer-record/get?id=` + id })
  },

  // 新增用户回答记录
  createAnswerRecord: async (data: AnswerRecordVO) => {
    return await request.post({ url: `/record/answer-record/create`, data })
  },

  // 修改用户回答记录
  updateAnswerRecord: async (data: AnswerRecordVO) => {
    return await request.put({ url: `/record/answer-record/update`, data })
  },

  // 删除用户回答记录
  deleteAnswerRecord: async (id: number) => {
    return await request.delete({ url: `/record/answer-record/delete?id=` + id })
  },

  // 导出用户回答记录 Excel
  exportAnswerRecord: async (params) => {
    return await request.download({ url: `/record/answer-record/export-excel`, params })
  },
}